{% extends 'base.html' %}

{% block title %}
{{ category_name }}分类
{% endblock %}

{% block content %}
<div class="content-wrap">
    <div id="content" class="content">
        <section id="posts" class="posts-collapse">
        <span class="archive-move-on"></span>

        <div class="collection-title">
        <h2 class="archive-year motion-element" id="archive-year-2017" style="opacity: 1; display: block; transform: translateX(0px);">{{ category_name }}<small> | 分类</small></h2>
        </div>

            {% for blog in cate_blogs.object_list %}
                <article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article" style="opacity: 1; display: block; transform: translateY(0px);">
                    <header class="post-header">
                        <h1 class="post-title">
                            <a class="post-title-link" href="{% url 'blog_id' blog.id %}" itemprop="url">
                                <span itemprop="name">{{ blog.title }}</span>
                             </a>
                        </h1>

                        <div class="post-meta">
                            <time class="post-time" itemprop="dateCreated" datetime="#" content="2017-09-01">
                        {{ blog.create_time|date:"m-d" }}
                            </time>
                          </div>
                    </header>
                </article>
            {% endfor %}

        </section>



          <!--分页展示-->
<nav class="pagination">
    <div class="pageturn">
        <ul class="pagelist">

        {% if cate_blogs.has_previous %}
            <li class="long"><a href="?{{ cate_blogs.previous_page_number.querystring }}">上一页</a></li>
        {% endif %}

        {% for page in cate_blogs.pages %}
        {% if page %}
            {% ifequal page cate_blogs.number %}
                <li class="active"><a href="?{{ page.querystring }}">{{ page }}</a></li>
            {% else %}
                 <li><a href="?{{ page.querystring }}" class="page">{{ page }}</a></li>
            {% endifequal %}
        {% else %}
            <li class="none"><a href="">...</a></li>
        {% endif %}
        {% endfor %}
        {% if cate_blogs.has_next %}
            <li class="long"><a href="?{{ cate_blogs.next_page_number.querystring }}">下一页</a></li>
        {% endif %}

        </ul>
    </div>
</nav>

    </div>

</div>
{% endblock %}
